package com.shenfc.fxzj.service.impl;

import com.shenfc.fxzj.domain.Member;
import com.shenfc.fxzj.mapper.MemberMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shenfc.fxzj.service.IMemberService;

/**
 * 用户接口类
 */
@Service("memberService")
public class MemberServiceImpl implements IMemberService {
    @Autowired
    private MemberMapper memberMapper;


    @Override
    public Member getMemberById(Long id) {
        return memberMapper.selectByPrimaryKey(id);
    }

    @Override
    public int addMember(Member member) {
        return memberMapper.insertSelective(member);
    }

    @Override
    public int updateMember(Member member) {
        return memberMapper.updateByPrimaryKeySelective(member);
    }

    @Override
    public Member checkLogin(String userName, String password) {
        return memberMapper.checkLogin(userName,password);
    }

    @Override
    public Member getMemberByUserName(String userName) {
        return memberMapper.getMemberByUserName(userName);
    }
}
